home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / MacTide 1.3.3 / README < prev    next >
Encoding:
Text File  |  1995-12-28  |  37.0 KB  |  941 lines  |  [TEXT/MPS ]

  1.     XTide  Harmonic tide clock and tide predictor
  2.     Version 1.3.3  12/5/95
  3.  
  4.     Copyright (C) 1995  David Flater.
  5.     Also starring:  Jef Poskanzer; Jack Greenbaum; Rob Miracle;
  6.     Geoff Kuenning; Dale DePriest.
  7.  
  8.     This program is free software; you can redistribute it and/or modify
  9.     it under the terms of the GNU General Public License as published by
  10.     the Free Software Foundation; either version 2 of the License, or
  11.     (at your option) any later version.
  12.  
  13.     This program is distributed in the hope that it will be useful,
  14.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.     GNU General Public License for more details.
  17.  
  18.     You should have received a copy of the GNU General Public License
  19.     along with this program; if not, write to the Free Software
  20.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22.  
  23.     The tide prediction algorithm used in this program was developed
  24.     with United States Government funding, so no proprietary rights
  25.     can be attached to it.  For more information, refer to the
  26.     following publications:
  27.  
  28.     Manual of Harmonic Analysis and Prediction of Tides.  Special
  29.     Publication No. 98, Revised (1940) Edition.  United States
  30.     Government Printing Office, 1941.
  31.  
  32.     Computer Applications to Tides in the National Ocean Survey.
  33.     Supplement to Manual of Harmonic Analysis and Prediction of Tides
  34.     (Special Publication No. 98).  National Ocean Service, National
  35.     Oceanic and Atmospheric Administration, U.S. Department of
  36.     Commerce, January 1982.
  37.  
  38.  
  39. THIS PACKAGE IS AVAILABLE FOR ANONYMOUS FTP FROM:
  40. ftp://speckle.ncsl.nist.gov/flater/sources/xtide-1.3.3.tgz
  41. (The version number may change.)
  42.  
  43. An illustrated, HTML-ized version of this README is available at:
  44. http://case50.ncsl.nist.gov/xtide/xtide.html
  45.  
  46.  
  47. Overview
  48. --------
  49.  
  50. Xtide was originally intended to be a "tide clock."  Lots of people
  51. down on the shore have them -- it's just an analog clock that's been
  52. marked with high and low tide, that makes a complete cycle in a bit
  53. over 12 hours.  There's just one minor problem with them, which is
  54. that they are only accurate to within plus or minus 50% of reality.  I
  55. felt kind of stupid having a square thingy on my screen that just went
  56. up and down and paid no attention to the actual water level outside.
  57.  
  58. Xtide is now a bit more accurate than that, but there's a cost
  59. associated:  you need to (somehow) get the harmonic constants for your
  60. location.  This is a set of numbers that tells Xtide everything it
  61. needs to know to predict your local tides.  More will be said about
  62. this below.
  63.  
  64. Xtide has three basic modes of operation:  clock mode, graph mode, and
  65. text mode.  Clock mode has "simple" and "hairy" sub-modes; graph mode
  66. has three sub-modes, one for each type of output it can generate (X,
  67. PPM, or ASCII); text mode has "regular," "calendar," and "banner"
  68. sub-modes.  The default mode is clock mode.
  69.  
  70. The program Tide is a stripped down interface to XTide that can
  71. compile without the X11 libraries.  It only supports text, PPM, and
  72. ASCII graph output.
  73.  
  74. By default, all timestamps are displayed in your local time zone.  The
  75. exact appearance of timestamps on the screen will vary depending on
  76. the mode.  You can use the -utc switch to change the time zone to UTC,
  77. or specify an offset from UTC with the -tz switch.  If you are feeling
  78. lucky, the -loctz switch will try to get the time zone of the location
  79. being displayed.  -loctz is fragile, especially on System V machines
  80. where it is likely to yield incorrect results on any location outside
  81. the U.S.
  82.  
  83. The tick marks on the horizontal axis of a tide graph are one hour
  84. apart.  The other tick marks are whatever units of depth were used for
  85. the amplitudes for the location being shown.  They are calibrated with
  86. the mean lower low water datum, or whatever datum was given in the
  87. harmonics file (possibly some other mean low water variant or even
  88. mean sea level).
  89.  
  90. Starting with version 1.1, the matching of location names specified
  91. with -location is case-insensitive, and you only have to specify
  92. enough letters to uniquely identify the location that you want.
  93.  
  94.  
  95. Clock Mode
  96. ----------
  97.  
  98. The tide clock shows the current water level and the predicted times
  99. of the next high and low tides.  The water is blue if it is flowing,
  100. green if it is ebbing.  You can change the colors with command line
  101. switches (-fgrise, -fgfall).
  102.  
  103. The -skinny option allows the window to be more narrow by abbreviating
  104. timestamps to four digits, in military time.  "7:28 PM EDT" becomes
  105. simply "1928".  -skinny will cause similar changes in the timestamps
  106. displayed in graph mode and text mode.
  107.  
  108. The -hairy option causes the tide clock to track the tide curve
  109. instead of simply showing the current water level.  The -gstretch
  110. option can be used with -hairy to control the aspect ratio of the
  111. graphing.  Values greater than 1 stretch it out, while values between
  112. 0 and 1 scrunch it up.
  113.  
  114. If you don't specify -calib or -tinc, the hour marks will be
  115. calibrated with the current time (marking one hour from now, one hour
  116. ago, etc.).  -calib causes the hour marks to be calibrated with the
  117. top of the hour.  -tinc causes the hour marks to be calibrated and
  118. also labels them.  If you don't specify an increment, every hour is
  119. labeled.
  120.  
  121. The -now option causes the current time to be displayed in the tide
  122. clock.  This is handy if the tide clock is set to a different time
  123. zone and you want to know what time it is over there.  It may also
  124. alleviate the need for a separate xclock.
  125.  
  126. -hinc causes the depth marks to be labeled.  If you don't specify an
  127. increment, XTide will choose one that is reasonable.
  128.  
  129. -mark, -middle, and -mllw draw lines at various depth levels that may
  130. be of interest to you.
  131.  
  132.  
  133. Graph Mode
  134. ----------
  135.  
  136. Graph mode, triggered with the -graph switch, draws a graph of the
  137. water level for two days and labels the high and low tides.  By using
  138. -gstart with -graph, you can predict tides far into the future.  The
  139. -gstart time spec is in your local time zone; this does not change if
  140. you specify -utc or -tz, but may be affected by -loctz.  Close the
  141. window or kill the program to get rid of the graph.
  142.  
  143. The -mark switch, in addition to drawing a horizontal line at the
  144. water level you specify, causes the times of rising and falling
  145. transitions of that line to be displayed.
  146.  
  147. The -now switch causes a cross to be drawn on the graph to indicate
  148. the current time, and the graph to be centered around the current time
  149. if not overridden by -gstart.  Normally the graph only shows from the
  150. current time onward.
  151.  
  152. -tinc is still used to label the hour ticks in graph mode as it was in
  153. clock mode.  However, -calib is not needed in graph mode (the hour
  154. ticks are always calibrated with the top of the hour).  -hinc is
  155. enabled by default for graphs, but you can still use -hinc to change
  156. the increment used for labeling the depth marks.
  157.  
  158. The -ppm switch invokes an alternative graph mode that sends output to
  159. a PPM file instead of the X server.  You do not need to specify both
  160. -ppm and -graph.  The output from -ppm will look better than the
  161. output of -graph since the tide curve will be anti-aliased; however,
  162. the switches for changing the colors require you to use the syntax
  163. rgb:hh/hh/hh (where hh is a 2-digit hexadecimal number).  The
  164. dimensions can be specified with -geometry NxN.  (Previously it was
  165. necessary to use -ppmgeom instead of -geometry; -ppmgeom is still
  166. supported for compatibility.)
  167.  
  168. If you specify -text with -graph, you will get ASCII graph mode.  This
  169. produces a best-effort rendition of the tide graph for a TTY:
  170.  
  171. Baltimore (Fort McHenry)
  172. [ |   09-07        09-07  |    09-08        09-08 |     09-09       09-09 ]
  173. [ |   0607         1823   |    0655         1916  |     0738        2006  ]
  174. [ |                       |                       |                       ]2.6
  175. [ |                       |                       |                       ]2.2
  176. [ |    ****               |     ****              |      ***          **  ]1.9
  177. [ |   ******        ****  |    ******       ***** |     ******       *****]1.5
  178. [ |  *********    ******* |   ********     *******|    ********     ******]1.2
  179. [ | ***********  *********|  **********   *********   **********   *******]0.8
  180. [*************************************************************************]0.5
  181. [*************************************************************************]0.1
  182. [*************************************************************************]-0.2
  183. [*************************************************************************]-0.6
  184. [9-06        09-07       09-08        09-08       09-09       09-09       ]
  185. [324         1236        0024         1317        0120        1356        ]
  186.  
  187. The -gstretch option lets you adjust how stretched out / crowded the
  188. graph is.  -gstretch 2.0 means that graph mode will stretch one day
  189. across the screen instead of two.  -gstretch 0.5 crowds four days in
  190. the same amount of space.
  191.  
  192. The -gstretch option may help you to read the high and low tide
  193. predictions if they were too close together on the graph.  You can
  194. also use the -skinny option along with -graph to get condensed
  195. timestamps that won't overlap as much.  If all else fails, use text
  196. mode.
  197.  
  198.  
  199. Text Mode
  200. ---------
  201.  
  202. Text mode, invoked with the -text switch, causes high and low tides,
  203. and rising and falling transitions of the -mark level if one is
  204. specified, to be listed to standard output:
  205.  
  206.           Baltimore (Fort McHenry)
  207.           Mark level:  2.000000
  208.                Rising:  1995-09-06  4:41 AM EDT  2.00
  209.             High Tide:  1995-09-06  5:16 AM EDT  2.03
  210.               Falling:  1995-09-06  5:52 AM EDT  2.00
  211.              Low Tide:  1995-09-06 11:51 AM EDT  0.68
  212.             High Tide:  1995-09-06  5:26 PM EDT  1.50
  213.  
  214. The floating point number at the end of the line is the tide height at
  215. the time of the high or low tide.  The -text switch takes an optional
  216. numeric argument to specify how many lines of output to generate, not
  217. including the header stuff.  The -gstart switch can be used to specify
  218. the starting time for -text, -calen, or -banner.
  219.  
  220. The -calen switch causes one month of tides to be formatted like a
  221. calendar.  Here is what one week looks like:
  222.  
  223.     Sunday Monday Tuesda Wednes Thursd Friday Saturday
  224.  
  225.     10-01  10-02  10-03  10-04  10-05  10-06  10-07
  226.  
  227.     H0045  H0149  H0254  H0356  H0453  H0545  L0024
  228.     1.92   1.89   1.85   1.81   1.76   1.70   0.47
  229.     L0724  L0831  L0934  L1030  L1119  L1203  H0631
  230.     0.73   0.71   0.66   0.59   0.53   0.46   1.63
  231.     H1234  H1349  H1506  H1617  H1719  H1814  L1243
  232.     1.29   1.28   1.33   1.42   1.53   1.64   0.41
  233.     L1841  L1952  L2106  L2218  L2324         H1903
  234.     0.40   0.44   0.47   0.48   0.47          1.73
  235.  
  236. "High Tide" and "Low Tide" are abbreviated to the single letters "H"
  237. and "L" prefixed to the timestamps.
  238.  
  239. The -banner switch produces a sideways ASCII tide graph, which is
  240. mainly for sending to dot matrix printers that use continuous printer
  241. paper.  The length of the output is controlled by -text, and the
  242. aspect ratio is controlled by -gstretch.
  243.  
  244.  
  245. Something for Everyone
  246. ----------------------
  247.  
  248. Additional command line switches are shown in the usage info:
  249.  
  250. Usage:  xtide [-banner]              Sideways ASCII tide graph
  251.               [-bg ...]              Background color
  252.               [-calen]               Make 1 month tide calendar (slow)
  253.               [-calib]               (Hairy)  Tick marks at top of the hour
  254.               [-check YYYY]          Check for errors in equilibrium arguments
  255.               [-config {filename | -}]  Read configuration file / stdin
  256.               [-cur]                 Restrict -location search to currents
  257.               [-display ...]         X display
  258.               [-fgfall ...]          Color of ebbing water
  259.               [-fgmark ...]          Color of mark line
  260.               [-fgmiddle ...]        Color of middle line
  261.               [-fgmllw ...]          Color of mllw line
  262.               [-fgrise ...]          Color of flooding water
  263.               [-fgtext ...]          Color of text and lines
  264.               [-geometry ...]        X or PPM geometry
  265.               [-graph]               Graph 2 days of tides (modulo gstretch)
  266.               [-gstart YYYY:MM:DD:HH:MM]  Time at which to start graph or text
  267.               [-gstretch N.NN]       Adjust graph detail vs. time span
  268.               [-hairy]               Show slice of tide graph in the clock
  269.               [-hfile ...]           Location and name of harmonics file
  270.               [-hinc [N]]            Label depth marks in increments of N
  271.               [-hloff [-]N.NN]       (Text)  Tide level offset for high tide
  272.               [-htoff [-]HH:MM]      (Text)  Time offset for high tide
  273.               [-list]                List all locations in harmonics file
  274.               [-listtz]              List with meridians and time zone info
  275.               [-lloff [-]N.NN]       (Text)  Tide level offset for low tide
  276.               [-location "Name"]     Location to show tides for
  277.               [-loctz]               Try to use time zone of location (Moof!)
  278.               [-ltoff [-]HH:MM]      (Text)  Time offset for low tide
  279.               [-mark [-]N.NN]        Draw line at specified tide level
  280.               [-middle]              Draw line near mean tide level
  281.               [-mllw]                Draw line at mean lower low water level
  282.               [-nolines]             Suppress tick marks / depth lines
  283.               [-now]                 Show current time / mark place on graph
  284.               [-ppm {filename | -}]  Write graph as PPM to file / stdout
  285.               [-skinny]              Trim the fat, make window tall and skinny
  286.               [-test]                Test mode (mostly useless)
  287.               [-text [N]]            List N tides / select ASCII graph mode
  288.               [-tinc [N]]            Label each N hours
  289.               [-toplines]            (Graph)  Depth lines on top of graph
  290.               [-tz [-]HH:MM]         Fixed time zone offset for timestamps
  291.               [-utc]                 Show timestamps in UTC
  292.               [-version]             Print XTide version
  293.  
  294. Time format example -- half past midnight, June 1, 1995:  1995:06:01:00:30
  295. In PPM mode, colors must be specified as rgb:hh/hh/hh (where hh is a 2-digit
  296. hexadecimal number) and geometry must be specified as NxN.
  297.  
  298.  
  299. Usage:  tide [-banner]              Sideways ASCII tide graph
  300.              [-bg color]            Background color
  301.              [-calen]               Make 1 month tide calendar (slow)
  302.              [-check YYYY]          Check for errors in equilibrium arguments
  303.              [-config {filename | -}]  Read configuration file / stdin
  304.              [-cur]                 Restrict -location search to currents
  305.              [-fgfall color]        Color of ebb current
  306.              [-fgmark color]        Color of mark line
  307.              [-fgmiddle color]      Color of middle line
  308.              [-fgmllw color]        Color of mllw line
  309.              [-fgrise color]        Color of normal graph / flood current
  310.              [-fgtext color]        Color of text and lines
  311.              [-geometry NxN]        PPM geometry
  312.              [-graph]               ASCII graph mode
  313.              [-gstart YYYY:MM:DD:HH:MM]  Time at which to start
  314.              [-gstretch N.NN]       Adjust graph detail vs. time span
  315.              [-hfile ...]           Location and name of harmonics file
  316.              [-hinc [N]]            Label depth marks in increments of N
  317.              [-hloff [-]N.NN]       (Text)  Tide level offset for high tide
  318.              [-htoff [-]HH:MM]      (Text)  Time offset for high tide
  319.              [-list]                List all locations in harmonics file
  320.              [-listtz]              List with meridians and time zone info
  321.              [-lloff [-]N.NN]       (Text)  Tide level offset for low tide
  322.              [-location "Name"]     Location to show tides for
  323.              [-loctz]               Try to use time zone of location (Moof!)
  324.              [-ltoff [-]HH:MM]      (Text)  Time offset for low tide
  325.              [-mark [-]N.NN]        Draw line at specified tide level
  326.              [-middle]              Draw line near mean tide level
  327.              [-mllw]                Draw line at mean lower low water level
  328.              [-nolines]             Suppress tick marks / depth lines
  329.              [-now]                 Mark current time on graph
  330.              [-ppm {filename | -}]  Write graph as PPM to file / stdout
  331.              [-skinny]              Abbreviate timestamps
  332.              [-text N]              List N tides to standard output
  333.              [-tinc [N]]            Label each N hours
  334.              [-toplines]            (PPM)  Depth lines on top of graph
  335.              [-tz [-]HH:MM]         Fixed time zone offset for timestamps
  336.              [-utc]                 Show timestamps in UTC
  337.              [-version]             Print Tide version
  338.  
  339. Time format example -- half past midnight, June 1, 1995:  1995:06:01:00:30
  340. Colors must be specified as rgb:hh/hh/hh (where hh is a 2-digit hexadecimal
  341. number)
  342.  
  343.  
  344. You NEED Harmonic Constants
  345. ---------------------------
  346.  
  347. You cannot predict tides for your locale unless you know its harmonic
  348. constants.  A database of harmonic constants is kept in the harmonics
  349. file.  The most recent version of the harmonics file is available for
  350. anonymous FTP at ftp://speckle.ncsl.nist.gov/flater/sources/harmonics.gz.
  351. (Footnote:  The file 'harmonics' in the same directory is the old one,
  352. for versions 1.1.1 and older; it will eventually be deleted.)  FTP it
  353. and gunzip it.  As of 9/10/95, there are approximately 220 locations
  354. supported.
  355.  
  356. If your location is not among those already in the harmonics file,
  357. then getting constants for your location could be a real pain.  You
  358. can do what I did, and pay the National Ocean Service (in the U.S.)
  359. ten dollars for one set of constants.  Otherwise, lots of luck.  If
  360. you do go through the trouble, and the data that you get can be freely
  361. distributed, please send it to me so that I can add it to the end of
  362. the harmonics file that I distribute.  If enough people do this, I
  363. might actually assemble a halfway decent database.
  364.  
  365. If you send me a set of constants, be sure to preface it with comment
  366. lines giving your name, your e-mail address, where you got the data,
  367. how old the data is, and the units used for amplitude.  The age of the
  368. data is significant not only because geographical changes can
  369. invalidate a set of constants, but because the NOS changed which datum
  370. they used for many locations in 1989.
  371.  
  372.  
  373. The National Ocean Service and Similar Non-U.S. Organizations
  374. -------------------------------------------------------------
  375.  
  376. The quickest way to get harmonic constants from the NOS is to fax a
  377. request to 301-713-4436 asking for the 37 constituents for someplace
  378. at or near XYZ.  Provide your snail mail address.  They will mail you
  379. a bill at the same time that they mail the data.  It will be one or
  380. two weeks before you get it.  You can call 301-713-2877 if you want to
  381. try to check on its progress.
  382.  
  383. There are a number of organizations world wide that are capable of
  384. providing harmonic constants.  I know little about them except that
  385. they exist, and that the system of 37 constituents used by the NOS is
  386. not used by all of them.  The harmonics file that I provided is set up
  387. for the NOS system.  Given sufficient information, you should be able
  388. to modify the harmonics file to use whatever system is used by your
  389. favorite organization.  I cannot currently provide harmonics files to
  390. work with every possible system, since I don't know anything about any
  391. of them except the one used by the NOS.  However, if you construct a
  392. harmonics file for a different system, please send it to me with a
  393. description of whose system it implements, and I will gladly add it to
  394. this distribution.  I will also include here any information that is
  395. sent to me to help other people get harmonic constants from different
  396. organizations.
  397.  
  398.  
  399. Getting Harmonic Constants from your Back Yard
  400. ----------------------------------------------
  401.  
  402. If you are ambitious and have access to regular water level readings
  403. for your locale over the course of, oh, a YEAR or so, you can derive
  404. the harmonic constants yourself.  I will be just as happy to
  405. distribute sets of harmonic constants that you derive; see above for
  406. how to send them to me.
  407.  
  408. At the moment we do not have a working program for deriving harmonic
  409. constants, but Dean Pentcheff (dean@tbone.biol.sc.edu) is looking at
  410. porting the source code given in Computer Applications to Tides in the
  411. National Ocean Survey.  That publication can be gotten from the NOS by
  412. faxing a request to the same number as provided above for harmonic
  413. constants.  It costs ten dollars.
  414.  
  415.  
  416. The Harmonics File
  417. ------------------
  418.  
  419. An incompatible change to the format of the harmonics file was made
  420. with version 1.2 of XTide.  Earlier versions will no longer work.  The
  421. change was to add a field for the DATUM so that "absolute" tide
  422. heights can be calculated.
  423.  
  424. The harmonics file contains definitions for the 37 constituents used
  425. by the NOS and whatever meager database of harmonic constants I have
  426. managed to collect.  The data that must be entered for each location
  427. are described in the comments:
  428.  
  429. # Harmonic constants for all locations that we can predict tides for.
  430. # First line:  name of location.
  431. # Second line:  time meridian [whitespace] tzfile.
  432. # Third line:  DATUM.
  433. # Remaining lines:  identifier [whitespace] amplitude [whitespace] epoch.
  434. # The DATUM is the mean lower low water, or equivalent number for
  435. # calculating the absolute tide height.
  436. # The time meridian takes the format [-]HH:MM and is hours east of
  437. # Greenwich.  This is your time zone displacement in the _winter_.  Do
  438. # not include Daylight Savings Time!
  439. # The tzfile is a reference to a file in the zoneinfo directory as
  440. # described in the man page for tzset on BSD machines.  You may omit
  441. # this if you have no idea, but the -loctz switch won't work for that
  442. # location.
  443. # Amplitude units do not matter; they will not be converted.
  444. # Epoch is "modified" or "adapted" epoch in degrees, also known as
  445. # Kappa Prime.
  446. # The identifiers are for readability only; xtide assumes that they
  447. # are in the same order as defined above.
  448.  
  449. On the newest NOS printout, the columns you want to enter are labeled
  450. H (amplitude) and Kappa Prime (modified epoch).  My printout doesn't
  451. have mean lower low water, so I used MSL (Mean Sea Level) for the
  452. DATUM.  If you get MLLW, then use it.
  453.  
  454. On the old Form 444, you want to enter the values from column H
  455. (amplitude) and the _negations_ of the values in column D (-k').  The
  456. DATUM is listed off to the right (in the remarks section) on the line
  457. marked A0; right below that it tells you whether it's mean lower low
  458. water, or what.  It tells you what your meridian is at the top of that
  459. section -- but you have to negate that too.
  460.  
  461. Unless there is some major incompatibility, you should be able to
  462. modify the harmonics file to use a different method to calculate
  463. tides, with more or less constituents (like the 114-constituent system
  464. for Anchorage, or the system used by a data service other than NOS).
  465. However, it is assumed that all sets of harmonic constants in a given
  466. harmonics file are on the same system, so you will have to specify a
  467. different harmonics file on the command line if you want to do
  468. multiple locations with different tide prediction methods.
  469.  
  470.  
  471. What About Currents?
  472. --------------------
  473.  
  474. XTide can do simple reversing currents, because the math required to
  475. do them is identical to the math for predicting tides.  If a location
  476. in the harmonics file has the word "Current" in its name, then XTide
  477. assumes that it is a data set for predicting currents instead of
  478. tides, and tries to generate output that is more appropriate to
  479. currents.  The following things are different for currents:
  480.  
  481. 1.  Units change from length to velocity.
  482. 2.  MLLW is replaced by the velocity of the permanent current.
  483. 3.  The -mark mechanism is hardwired to find Slack Water (0 current).
  484. 4.  Captions change from "High Tide" to "Max Flood," etc.
  485. 5.  Graphical output is modified to show values as being above and
  486. below Slack Water instead of originating from the bottom of the
  487. window.
  488. 6.  Many tide-specific switches will generate meaningless results.
  489.  
  490.  
  491. Installation
  492. ------------
  493.  
  494. If you just want to see what the program looks like, you can skip
  495. step 1.  Non-ANSI compilers need not apply.
  496.  
  497. 1.  You NEED the harmonic constants for your location.  I will keep an
  498. updated harmonics file available for anonymous FTP at
  499. ftp://speckle.ncsl.nist.gov/flater/sources/harmonics.gz.  If your
  500. location is not in it, read the previous sections to find out what to
  501. do about it.
  502.  
  503. 2.  Edit the #defines in config.h to specify the location and name of
  504. the harmonics file that you will use and the default location to show
  505. tides for.  The location that you specify must be in the harmonics
  506. file.  NOTE:  The environment variables LOCATION and HFILE override
  507. the values specified in config.h.
  508.  
  509. 3.  Copy the harmonics file to the place that you have decided to put
  510. it and chmod 644.
  511.  
  512. IF YOU HAVE X LIBRARIES:
  513.  
  514.   4.  xmkmf; make depend; make.
  515.  
  516.   5.  Copy the xtide executable into /usr/X11R6/bin or whatever.
  517.  
  518. IF YOU DON'T HAVE X LIBRARIES:
  519.  
  520.   4.  Copy Makefile.tide to Makefile and edit as desired.
  521.  
  522.   5.  make.
  523.  
  524. 6.  Copy the tide executable into /usr/local/bin or whatever.
  525.  
  526. 7.  Copy xtide.man to /usr/man/man1/xtide.1 and chmod 644.
  527.  
  528.  
  529. OS/2 Installation
  530. -----------------
  531. (Ported by Dale DePriest)
  532.  
  533. Tide now includes support for OS2.  This port has been specifically
  534. tested using the gcc/emx version 0.9a.  Xtide could also be ported
  535. if you have a copy of the X libraries.  To build your copy of tide:
  536.  
  537. 1. copy makefile.os2 to Makefile
  538. 2. run nmake or make.
  539.  
  540. EMX does not support Daylight savings time so it is probably best to
  541. run tide with the -tz option.  For PDT use -tz -7:0.  For standard times
  542. you can set the environmental variable TZ or EMXTZ.  An example would
  543. be 'set TZ = PST8PDT'.  The -loctz switch might do this for you.
  544.  
  545.  
  546. AIX and HP-UX Installation
  547. --------------------------
  548. (Ported by Dale DePriest)
  549.  
  550. When compiling on these platforms, use the following compiler switches:
  551.  
  552. AIX:          CC = c89 -DAIX -D_XOPEN_SOURCE
  553. HP-UX:        CC = c89 -D_XOPEN_SOURCE
  554.  
  555.  
  556. Configuration Files
  557. -------------------
  558.  
  559. Config files are strictly optional.  They are a convenience feature.
  560. There is nothing you can do in config files that you can't do on the
  561. command line.  However, if you are making a web interface to XTide, it
  562. is probably a lot safer to pipe in arguments with -config - than to
  563. put them on the command line.
  564.  
  565. XTide (Tide) will attempt to read config files in the following order:
  566.  
  567. 1.  Any and all config files specified with the -config switch.
  568. 2.  The config file specified in the environment variable XTIDERC
  569. (TIDERC).
  570. 3.  ~/.xtiderc (~/.tiderc).  The environment variable HOME must be set
  571. for this to work.
  572. 4.  The system config file specified by the xsysconfig (sysconfig)
  573. #define in config.h.
  574.  
  575. Only one config file will be read, except if the -config switch is
  576. used multiple times.  Config files take effect before the command line
  577. is processed except for those specified with -config, which take
  578. effect at the place that -config occurs in the command line.
  579.  
  580. The format of a config file is just like the command line, except that
  581. you can't do anything fancy.  Arguments can be delimited with double
  582. quotes, and # causes the rest of the line to be interpreted as
  583. comments.
  584.  
  585.          # Here is an example config file
  586.          -loctz -location "Wherever I May Roam"
  587.          -fgrise uglybrown  # Ugly brown is actually quite pretty
  588.  
  589.  
  590. Bugs
  591. ----
  592.  
  593. 1.  The node factors and epoch are changed abruptly at the stroke of
  594. midnight on New Year's Eve GMT.  This causes a slight discontinuity
  595. which may cause spurious high and low tide predictions.  As a
  596. corollary, on a graph spanning two years, the depth lines will be
  597. wrong for one year or the other -- unless you figure out the secret to
  598. making it display _both_ sets of lines!
  599.  
  600. 2.  Because of the slackful matching used to find data sets in the
  601. harmonics file, if one data set has a name that is a prefix of the
  602. name of a second data set, such as "San Francisco" and "San Francisco
  603. Current", then the first data set must appear earlier in the harmonics
  604. file, or it will not be selectable.  (Typing "San Francisco" would
  605. get you "San Francisco Current".)
  606.  
  607. 3.  The -loctz switch probably will never work perfectly on any flavor
  608. of Unix.
  609.  
  610.  
  611. XTide FAQ
  612. ---------
  613.  
  614. Q:  "First it says high tide is at 3:15 PM but then when I run it again
  615. it says 3:14 PM!"
  616.  
  617. A:  Xtide's accuracy is plus or minus one minute.  The behavior that
  618. you witnessed is normal.
  619.  
  620. Q:  "The -skinny option doesn't make it much skinnier...."
  621.  
  622. A:  It's your window manager.  Some window managers won't let windows
  623. go outside of a certain aspect ratio; some won't let a window get
  624. smaller than is needed to display all the buttons in its title bar.
  625.  
  626. Q:  "The tides for my location are totally wrong!"
  627.  
  628. A:  Try negating all the epoch values for your location in the
  629. harmonics file.  If it works, tell me about it so I can make the
  630. change permanent.  Sign inversion is a ubiquitous problem for sets of
  631. harmonic constants, and there's no way for me to know when it's wrong
  632. unless somebody with access to reliable tide tables for that location
  633. tells me so.
  634.  
  635. Q:  "Has this been ported to Windows / OS/2 / anything but Unix?"
  636.  
  637. A:  Only a little bit.  The TTY-only client now compiles under OS/2
  638. thanks to Dale DePriest; Eric Lyons (lyons@nbn.com) said that it
  639. already compiles under Windows NT.  Eric has indicated that he may
  640. port XTide to Windows.
  641.  
  642. Q:  "So is there a Mac version?"
  643.  
  644. A:  NO!
  645.  
  646. Q:  "I know that you said that -loctz is fragile, but it's not even
  647. working for U.S. locations."
  648.  
  649. A:  Try adding -DBROKEN_ZONEINFO to the compile switches.  If it helps,
  650. and you can send me a predefined identifier for your OS (like #ifdef
  651. OS2), then I'll make it so that BROKEN_ZONEINFO will be defined
  652. automatically on your OS.
  653.  
  654.  
  655. Acknowledgements
  656. ----------------
  657.  
  658. Thanks to Greg Seidman (anthro@cs.umd.edu) for suggesting many of the
  659. features that appeared in version 1.
  660.  
  661. Thanks to Frank Smith (frank@nwra.com) for supplying data and putting
  662. up with my confused e-mail during the stressful debugging of 1.0.1.
  663.  
  664. Thanks to Karl Hahn (hahn@lds.loral.com) for supplying a huge number
  665. of harmonic constants.
  666.  
  667. Thanks to Dale DePriest (daled@cadence.com) for suggesting many new
  668. features, beta testing, and porting to several flavorful operating
  669. systems.
  670.  
  671. Thanks to Dean Pentcheff (dean@tbone.biol.sc.edu) for beta testing,
  672. suggesting features, supplying many data sets, and generally being
  673. very active in promoting XTide.
  674.  
  675. Thanks to Jef Poskanzer (jef@ee.lbl.gov) for much coding, suggesting
  676. of features, and beta testing.
  677.  
  678. Thanks to Jack Greenbaum (jackg@crc.ricoh.com) for coding, suggesting
  679. features, beta testing, and doing the homework to get prediction of
  680. currents figured out.
  681.  
  682. Thanks to Rob Miracle (rwm@mpgn.com) for the Ultrix compatibility
  683. patch.
  684.  
  685. Thanks to Georg Vollmers (georg@egalize.han.de), Tom Varga
  686. (tvarga@lsil.com), and Bob Kenney (rmk@unh.edu) for suggesting new
  687. features.
  688.  
  689. Thanks to Andrew Davidson (andrew.davidson@eng.sun.com) for helping
  690. with Solaris compatibility.
  691.  
  692. Thanks to Geoff Kuenning (geoff@ficus.cs.ucla.edu) for the SunOS
  693. patch.
  694.  
  695. Thanks to Jeff Small (jeff@cjsa.com) for suggesting features and
  696. writing the man page.
  697.  
  698.  
  699. Contact Info
  700. ------------
  701.  
  702. David Flater
  703. dave@case50.ncsl.nist.gov
  704.  
  705.  
  706. Changelog
  707. ---------
  708.  
  709. Patch 3 to 1.3, 12/5/95:
  710.  
  711. Closest matching color code forgot to allocate the color once it found
  712. it.
  713.  
  714.  
  715. Patch 2 to 1.3, 12/4/95:
  716.  
  717. Updated BROKEN_ZONEINFO code to add a few more time zones.
  718.  
  719. Cleaned up binary garbage left in the time zone spec by some time zone
  720. files.
  721.  
  722.  
  723. Patch 1 to 1.3, 11/29/95:
  724.  
  725. Fixed negative X and Y specs in X geometries.
  726.  
  727. Added code to substitute the closest available color instead of
  728. barfing when color map is full.
  729.  
  730. Updated the text of some error messages to be more accurate.
  731.  
  732.  
  733. Version 1.3, 10/31/95:
  734.  
  735. Added -hinc and -tinc.  Turned on vertical labeling by default in
  736. graph and PPM, with best-guess increments.
  737.  
  738. Environment variables LOCATION and HFILE now override config.h.
  739.  
  740. Integrated OS/2 patch from Dale DePriest.
  741.  
  742. -version now stops the show.
  743.  
  744. Print more illuminating error message when color map is full.
  745.  
  746. Support config files.
  747.  
  748. Added -loctz.
  749.  
  750. Support currents.
  751.  
  752. Made -loctz work some of the time under IRIX.
  753.  
  754. Added -cur.
  755.  
  756. Support comments in config files.
  757.  
  758. Support -tinc in hairy mode.
  759.  
  760. Cleaned up more Solaris compiler warnings.
  761.  
  762. AIX and HP compatibility courtesy of Dale DePriest.
  763.  
  764. Never-ending maintenance on BROKEN_ZONEINFO code.
  765.  
  766. Changed "line discipline" for ASCII graph mode.
  767.  
  768. Fixed a potential segmentation violation when mark lines aren't in the
  769. visible range on the graph.
  770.  
  771. Allow changing colors in PPM mode; made -geometry work in PPM mode
  772. too.
  773.  
  774. Added -toplines.
  775.  
  776. -now works with -graph and -ppm to center the graph around the current
  777. time and mark it on the graph.
  778.  
  779. Harmonized color syntax for PPM mode with X color syntax.
  780.  
  781. Expanded the workable range in graph mode (for Deception Pass).
  782.  
  783. Fixed some stupid typos.
  784.  
  785. Added some friendly error messages.
  786.  
  787. -hinc now defaults to a reasonable value instead of always 1.
  788.  
  789. Added -calen.
  790.  
  791. Minor cleanups.
  792.  
  793. Made font spec more specific to fix portability problem.
  794.  
  795. Print out location name and mark level at top of all text modes.
  796.  
  797. Fixed BROKEN_ZONEINFO again.
  798.  
  799. Added -banner.
  800.  
  801. Don't display mark setting for currents since it's always 0.
  802.  
  803. Changed prev_day, increment_day to be more robust with DST changes.
  804.  
  805. Go for one more hour when drawing hour ticks so that -tinc will draw
  806. partial digits in a symmetrical manner.
  807.  
  808. Dynamically allocate memory for -calen instead of static.
  809.  
  810. Go for one more hour on day marks too.
  811.  
  812.  
  813. Patch 3 to 1.2, 9/12/95:
  814.  
  815. Again fixed the problem with tides changing out of synch with the
  816. water color in the tide clock.
  817.  
  818.  
  819. Patch 2 to 1.2, 9/11/95:
  820.  
  821. Geoff Kuenning (geoff@ficus.cs.ucla.edu) sent a patch to work around a
  822. broken assert macro on SunOS 4.1.1.
  823.  
  824.  
  825. Patch 1 to 1.2, 9/11/95:
  826.  
  827. Accept either SVR4 or __svr4__ to avoid using the old SunOs code under
  828. Solaris.
  829.  
  830. Default location of harmonics file if you don't change config.h is now
  831. current directory.
  832.  
  833.  
  834. Version 1.2, 9/10/95:
  835.  
  836. Jef split xtide.c into xtide.c, tide.c, and tidelib.c to allow people
  837. without X libraries to compile a text-only client.
  838.  
  839. Tide levels reported in text mode are now adjusted to mean lower low
  840. water, or whatever tide datum has been provided.  An incompatible
  841. change to the format of the harmonics file was made to support this.
  842.  
  843. Added -hloff, -htoff, -lloff, -ltoff, and -mark.
  844.  
  845. Put mark and middle lines on top of the graph.  Made them red.
  846.  
  847. Jack made the title of the graph different from that of the tide
  848. clock, added switches -mllw and -fgmllw, and provided code to
  849. calibrate the depth marks with MLLW.  Messed with the calibrated tick
  850. mark code, then made it the default.  Also stopped tick marks from
  851. clobbering text.
  852.  
  853. Removed year from dates in skinny mode (graph and text).
  854.  
  855. Integrated Rob's Ultrix compatibility patch.
  856.  
  857. Added a bunch of asserts to the argument parsing code.
  858.  
  859. Added the -ppm switch (one huge hack).
  860.  
  861. Usage info now goes to stderr.
  862.  
  863. Jef implemented ASCII graph mode and partially calibrated the tick
  864. marks with the top of the hour.  Finished it, made it the default.
  865.  
  866. Fixed an off-by-one error in ASCII graph mode and rounded everything.
  867.  
  868. Made -mark and -middle different colors.
  869.  
  870. Ooops -- I broke the tick marks in other timezones.  Fixed.
  871.  
  872. Removed non-sig-digs from tide heights printed in text mode.
  873.  
  874. Changed __svr4__ to SVR4 in #ifdefs because it wasn't working right on
  875. some version of Solaris.  Added (int) cast to strlen returns to
  876. silence compiler warnings on Solaris.
  877.  
  878. Enhanced -mark to show times when mark level is crossed.
  879.  
  880. Corrected an old bug that has been causing all the tide predictions to
  881. be late by 1 minute.
  882.  
  883. Hourly tick marks that mark day boundaries are thicker.
  884.  
  885. Labeled the PPM with the location.  Added a switch to change its size.
  886.  
  887. The special case code for mark transitions and tides at the same time
  888. had an off-by-one error.  Fixed.
  889.  
  890. Closed the interval used to detect mark transitions.
  891.  
  892. Fixed day marks for DST changes.
  893.  
  894.  
  895. Patch 1 to 1.1, 8/27/95:
  896.  
  897. Fixed a possible robustness problem that was introduced in 1.1 when I
  898. tried to get the high and low tide predictions in the tide clock
  899. always to update at the same time that the water changed color.  There
  900. was the potential for the tides to get permanently out of
  901. synchronization with the current time after a localized disturbance
  902. such as a change of epoch or resetting the system clock.
  903.  
  904.  
  905. Version 1.1, 8/26/95:
  906.  
  907. Next low tide is now displayed at the bottom of the window.
  908.  
  909. Fixed the bug that was causing off-by-one-pixel errors in window
  910. updates.
  911.  
  912. Added -middle, -now, -skinny, and -text switches.
  913.  
  914. Changed matching of locations specified on the command line to have
  915. more slack.  It's now case-insensitive, and you only need to type
  916. enough letters to uniquely identify the location that you want.
  917.  
  918. No more core dumps on assertion failures.
  919.  
  920. Assorted cleanups and nit fixes, but mainly just more spaghetti code
  921. for your reading enjoyment.
  922.  
  923.  
  924. Patch 2 to 1.0, 8/16/95:
  925.  
  926. Fixed two bugs that compensated in such a way that locations in the
  927. current time zone worked fine.  For locations in other time zones, the
  928. timestamps were totally wrong.
  929.  
  930. Time displacements of the form -HH:MM, where MM was nonzero, were
  931. being processed incorrectly.  Fixed.
  932.  
  933.  
  934. Patch 1 to 1.0, 8/5/95:
  935.  
  936. Fixed a potential underflow error that affected New Year's Day only,
  937. and only on machines where time_t is unsigned.
  938.  
  939.  
  940. Version 1.0 released locally on 8/4/95.
  941.